{% load analysis_tags %}
<section id="file">
    <h4><span class="glyphicon glyphicon-file" aria-hidden="true"></span> File <i>{{analysis.target.file.name}}</i>
    </h4>
    <div class="panel panel-default">
        <table class="table table-striped">
            <tr>
                <th class="text-right">Size</th>
                {% if analysis.target.file_id %}
                    <td>{{ analysis.target.file.size | sizeof_fmt }}</td>
                    <span class="pull-right">
                    <a class="btn btn-primary btn-xs" href="{% url "analysis.views.file" "sample" analysis.target.file_id %}">
                        <span class="glyphicon glyphicon-save" aria-hidden="true"></span> Download
                    </a>
                    <a class="btn btn-info btn-xs" href="{% url "submission.views.resubmit" analysis.info.id %}">
                        <span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> Resubmit sample
                    </a>
                    </span>
                {% endif %}
                </td>
            </tr>
            <tr>
                <th class="text-right">Type</th>
                <td>{{analysis.target.file.type}}</td>
            </tr>
            <tr>
                <th class="text-right">MD5</th>
                <td class="break-everywhere"><tt>{{analysis.target.file.md5}}</tt></td>
            </tr>
            <tr>
                <th class="text-right">SHA1</th>
                <td class="break-everywhere"><tt>{{analysis.target.file.sha1}}</tt></td>
            </tr>
            <tr>
                <th class="text-right">SHA256</th>
                <td class="break-everywhere"><tt>{{analysis.target.file.sha256}}</tt></td>
            </tr>
            <tr>
                <th class="text-right">SHA512</th>
                <td class="break-everywhere">
                    <button class="btn btn-primary btn-xs" type="button" data-toggle="collapse" data-target="#collapse-sha512" aria-expanded="false" aria-controls="collapseExample">
                    Show SHA512
                    </button>
                    <div class="collapse" id="collapse-sha512"><tt>{{analysis.target.file.sha512}}</tt></div>
                </td>
            </tr>
            <tr>
                <th class="text-right">CRC32</th>
                <td><tt>{{analysis.target.file.crc32}}</tt></td>
            </tr>
            <tr>
                <th class="text-right">ssdeep</th>
                <td class="break-everywhere"><tt>{{analysis.target.file.ssdeep}}</tt></td>
            </tr>
            {% if analysis.static.pdb_path %}
            <tr>
                <th class="text-right">PDB Path</th>
                <td>{{analysis.static.pdb_path}}</td>
            </tr>
            {% endif %}
            <tr>
                <th class="text-right">Yara</th>
                <td>
                {% if analysis.target.file.yara %}
                    <ul style="margin-bottom: 0;">
                    {% for sign in analysis.target.file.yara %}
                        <li>{{sign.name}} - {{sign.meta.description}}</li>
                    {% endfor %}
                    </ul>
                {% else %}
                    None matched
                {% endif %}
                </td>
            </tr>
        </table>
    </div>
</section>
